package com.cf.expensetracker.command;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
import com.beust.jcommander.Parameters;
import lombok.Data;

/**
 * Copyright(C) 2025- com.cf
 * FileName:    BudgetCmd
 * Author:      cf
 * Date:        2025/1/22 16:09
 * Description: Set budget command
 */
@Data
@Parameters(commandNames = "budget", commandDescription = "Set a budget for current month")
public class BudgetCmd {
    @Parameter(names = "--amount", description = "Amount of budget for current month", required = true)
    private Double amount;

    public void validate() throws ParameterException {
        if (amount <= 0) {
            throw new ParameterException("The budget amount must greater than zero .");
        }
    }
}
